<?php
/**
 * Created by PhpStorm.
 * User: woddp
 * Date: 2017/2/19
 * Time: 11:13
 */

namespace Home\Controller;

use Think\Controller;

class ArticleController extends Controller{

    //文章显示
    public function view(){
        $id=I('get.id');
        if(!$id){
            $this->error('文章不存在');
        }
        $article_model = M('Article');
        $conditionCategory['category_id'] = 18;
        $conditionCategory['status'] = 1;
        $ret_lunbo                        = $article_model->where($conditionCategory)->select();

        $this->assign('lunbo', $ret_lunbo);

        $conditionArticle['id'] = $id;
        $conditionArticle['status'] = 1;
        $ret_article                     = $article_model->where($conditionArticle)->find();
//        $ret_article['content']=htmlspecialchars_decode($ret_article['content'],ENT_QUOTES);
      
        $this->assign('article', $ret_article);

        $this->display();
    }
}